Optimal. Leaf size=103 \[ \frac {2 a^2 (3 B+2 C) \tan (c+d x)}{3 d}+\frac {a^2 (3 B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 (3 B+2 C) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {4054, 12, 3788, 3767, 8, 4046, 3770} \[ \frac {2 a^2 (3 B+2 C) \tan (c+d x)}{3 d}+\frac {a^2 (3 B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 (3 B+2 C) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 12
Rule 3767
Rule 3770
Rule 3788
Rule 4046
Rule 4054
Rubi steps
\begin {align*} \int (a+a \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {\int a (3 B+2 C) \sec (c+d x) (a+a \sec (c+d x))^2 \, dx}{3 a}\\ &=\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} (3 B+2 C) \int \sec (c+d x) (a+a \sec (c+d x))^2 \, dx\\ &=\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} (3 B+2 C) \int \sec (c+d x) \left (a^2+a^2 \sec ^2(c+d x)\right ) \, dx+\frac {1}{3} \left (2 a^2 (3 B+2 C)\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {a^2 (3 B+2 C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{2} \left (a^2 (3 B+2 C)\right ) \int \sec (c+d x) \, dx-\frac {\left (2 a^2 (3 B+2 C)\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {a^2 (3 B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {2 a^2 (3 B+2 C) \tan (c+d x)}{3 d}+\frac {a^2 (3 B+2 C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.37, size = 63, normalized size = 0.61 \[ \frac {a^2 \left ((9 B+6 C) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (3 (B+2 C) \sec (c+d x)+12 (B+C)+2 C \tan ^2(c+d x)\right )\right )}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.50, size = 125, normalized size = 1.21 \[ \frac {3 \, {\left (3 \, B + 2 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (3 \, B + 2 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, {\left (6 \, B + 5 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) + 2 \, C a^{2}\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.29, size = 178, normalized size = 1.73 \[ \frac {3 \, {\left (3 \, B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (3 \, B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (9 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.22, size = 141, normalized size = 1.37 \[ \frac {3 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {5 a^{2} C \tan \left (d x +c \right )}{3 d}+\frac {2 a^{2} B \tan \left (d x +c \right )}{d}+\frac {a^{2} C \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}+\frac {a^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a^{2} B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a^{2} C \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 167, normalized size = 1.62 \[ \frac {4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{2} - 3 \, B a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, C a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, B a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 24 \, B a^{2} \tan \left (d x + c\right ) + 12 \, C a^{2} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.72, size = 145, normalized size = 1.41 \[ \frac {2\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,B}{2}+C\right )}{d}-\frac {\left (3\,B\,a^2+2\,C\,a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-8\,B\,a^2-\frac {16\,C\,a^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (5\,B\,a^2+6\,C\,a^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int B \sec {\left (c + d x \right )}\, dx + \int 2 B \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sec ^{3}{\left (c + d x \right )}\, dx + \int C \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 C \sec ^{3}{\left (c + d x \right )}\, dx + \int C \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________